<?php

/*
 * This file belongs to Techno Web Solutions :: http://technowebsol.com
 */

/**
 * Description of Controller
 * Sep 13, 2012
 * File: controller.php
 * Encoding: UTF-8
 * Project: fbClone
 *
 * @author Suman Choudhury <suman@technowebsol.com>
 */
class Controller extends Loader{
    public $db;
    public $output;

    //put your code here
    public function __construct() {
        parent::__construct();
    }
    
    public function view($name, $isReturn = FALSE){
        $viewFile = THEME_PATH.  $this->config->themes['theme_path']."/$name".EXT;
        
        require_once $viewFile;
        /*$content = file_get_contents($viewFile);
        $content = str_replace("<?php", "", $content);
        $content = str_replace("<?", "", $content);
        $content = str_replace("?>", "", $content);
        
        $this->setOutput($content);
        if($isReturn){ 
            return $this->output;
        }*/
    }
    public function getOutput(){
        return $this->output;
    }
    public function setOutput($output){
        $this->output .= $output;
    }
    public function printOutput(){
        //echo $this->output;
        eval($this->getOutput());
    }
}

?>
